package com.ok.cartoon.controller;


import com.ok.cartoon.domain.po.OkCollection;
import com.ok.cartoon.service.IOkCartoonService;
import com.ok.cartoon.service.IOkCollectionService;
import com.ok.common.domain.po.Result;
import com.ok.common.utils.UserContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 收藏表 前端控制器
 * </p>
 *
 * @author lhw
 * @since 2024-05-13
 */
@Api(tags = "用户收藏相关接口")
@RestController
@RequestMapping("/collection")
@RequiredArgsConstructor
public class OkCollectionController {

    private final IOkCollectionService okCollectionService;

    @ApiOperation("*添加收藏")
    @PostMapping("/add")
    public Result add(@RequestParam Long cartoonId){
        okCollectionService.add(cartoonId);
        return Result.success("收藏成功");
    }

}
